package github.kawaiior.yuanchuxiuzhen.common.herb;

import github.kawaiior.yuanchuxiuzhen.util.EntityUtil;
import github.kawaiior.yuanchuxiuzhen.util.MathUtil;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.potion.Effects;
import net.minecraft.util.text.TranslationTextComponent;

public class HerbEffect_15 implements IHerbEffect{

    @Override
    public void onPlayerUse(PlayerEntity player, byte fireLevel, byte randomLevel) {
        player.heal(player.getMaxHealth()*(0.37F+0.05F*fireLevel+0.02F*randomLevel));
    }

    @Override
    public TranslationTextComponent getHerbEffectTextComponent(byte fireLevel, byte randomLevel) {
        return new TranslationTextComponent("pellet.effect.15",
                MathUtil.formatFloat((0.37F+0.05F*fireLevel+0.02F*randomLevel)*100, 2)+"%");
    }
}